package cn.ekuma.epos.crm.model;

import com.openbravo.bean.crm.CustomerAddress;
import com.openbravo.format.Formats;


import cn.ekuma.data.ui.swing.AbstractDTOTableModel;
import com.openbravo.pos.base.AppLocal;

public class CustomerAddressTableModel extends AbstractDTOTableModel<CustomerAddress>{

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
		CustomerAddress obj=this.getObj(rowIndex);
		switch(columnIndex){
		case 0:
			return obj.getPhone2();
		case 1:
			return obj.getFax();
		case 2:
			return obj.getAddress();
		case 3:
			return obj.getAddress2();
		case 4:
			return obj.getPostal();
		case 5:
			return obj.getCity();
		case 6:
			return obj.getRegion();
		case 7:
			return obj.getCountry();
		case 8:
			return Formats.TIMESTAMP.formatValue(obj.getCreateDate());
		}
		return null;
	}

	@Override
	public String[] getColumnNames() {
		return new String[]{
				AppLocal.getIntString("label.phone2"),
				
				AppLocal.getIntString("label.fax"),
				AppLocal.getIntString("label.address"),
				AppLocal.getIntString("label.address2"),
				AppLocal.getIntString("label.postal"),
				AppLocal.getIntString("label.city"),
				
				AppLocal.getIntString("label.region"),
				AppLocal.getIntString("label.country"),
				AppLocal.getIntString("label.createTime")
		};
	}
}
